package top.tagao.m03_beHavioralPatterns.b_03_state.old_way;

import com.alibaba.fastjson.JSON;
import lombok.extern.java.Log;
import top.tagao.m03_beHavioralPatterns.b_03_state.ActivityService;
import top.tagao.m03_beHavioralPatterns.b_03_state.Result;
import top.tagao.m03_beHavioralPatterns.b_03_state.Status;


/**
 * before 状态模式
 *
 * @author Viktor_Liu
 * @Date 2022/8/13 17:40
 * <p>
 * https://bugstack.cn/md/develop/design-pattern/
 */
@Log
public class Main {
    public static void main(String[] args) {
        // 初始化数据
        String activityId = "100001";
        ActivityService.init(activityId, Status.Editing);
        ActivityExecStatusController asc = new ActivityExecStatusController();
        Result result = asc.execStatus(activityId, Status.Editing, Status.Check);

        System.out.println("测试结果(编辑中To提交审核)  " + JSON.toJSONString(result));
        System.out.println(ActivityService.queryActivityStatus("100001"));

        Result resultCheck = asc.execStatus(activityId, Status.Editing, Status.Check);
        System.out.println("测试结果(编辑中To提交审核)：" +  JSON.toJSONString(resultCheck));



    }
}
